home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-03-30 | 4.4 KB | 170 lines | [TEXT/PvRy] |
- // Persistence Of Vision raytracer version 2.0 sample file.
- // You will need the "Pov-Ray (68040)" version to run it.
-
- /*
- ! WARNING !
-
- This file has been disigned to be rendered with an unofficial
- version of Pov-Ray, which is not supported by the POV-Ray team.
- You can get this version by anonymous ftp at the following address
- sumex-aim.stanford.edu (36.44.0.6)
- and download the "POV-68040.hqx" package.
-
- This version supports trigonometric fuctions and loops in the scene description.
- You will need a 68040 tu run it, but you will be able to render scenes quicker
- than with the official version. The speed gain ranges from 3% to 42% (average 12%)
-
- */
-
- // Example using loops to describe a scene.
- // 5 carved columns in granite lying on water.
- // For a quick look of the columns,
- // you may want to remove the ground in order
- // to increase the rendering speed.
-
- // ©N.Guex, March 1994
-
- /*
- You can use, modify and include these columns freely in your scenes,
- BUT : WARNING !
- • If you decide to share or post a scene that need any of the new features
- • to be rendered, you MUST indicate clearly that this scene was designed
- • specifically for my version and that it will request it to be rendered.
- • Specify also where users can find my version, and the type of computer
- • needed (Macintosh with 68040).
- • This is only to insure that regular users will not be confused with some
- • scenes that they are unable to render.
- */
-
- #include "FOV.inc"
- #include "colors.inc"
- #include "textures.inc"
- #include "shapes.inc"
-
- #declare posCamera = <0 ,10 ,-50 >
- #declare lookWhere = <0, -600, 6000>
- #declare XLight1 = -20
- #declare YLight1 = 35
- #declare ZLight1 = -30
-
- //••••••••••• Ligths & Camera •••••••••••
-
- camera {
- location posCamera
- direction <0 0 FoV_15>
- up <0 10 0>
- right <13.3 0 0>
- sky <0 10 0>
- look_at lookWhere
- rotate <0 0 0>
- }
-
- object {
- light_source { <XLight1, YLight1, ZLight1>
- color red 2 green 2 blue 2 }
- }
- object {
- light_source { <-XLight1, -YLight1, ZLight1>
- color red 1 green 1 blue 1 }
- }
-
- //••••••• T E X T U R E S ••••••••
-
- #declare ColumnTexture =
- texture {
- pigment {
- granite
- turbulence 0.3
- rotate <0 0 90>
- scale <.2 .07 .15>
- }
- finish {
- reflection 0
- ambient .1
- diffuse .6
- phong 1
- }
- }
-
- //••••••• O B J E C T S ••••••••
-
- //-------------------------------------------------
- // Declare a carved Column
- //-------------------------------------------------
-
- #declare n = 10 /* nbr of cylinders to carve at the column surface */
- #declare r1 = 5 /* column radius */
- #declare carvingDepth2 = +sqr(1.2) /* value must be >1 */
- #declare a = 360 / n /* angle between two centers of carving cylinders */
-
- #declare xx = r1 * sin(a/2) /* just to make further calculs easy */
-
- /* carving cylinder radius */
- #declare r2 = xx * sqrt(carvingDepth2 / (carvingDepth2 -1))
-
- /* dist between column center and carving cylinder center */
- #declare d = +sqrt(sqr(r1)- sqr(xx)) + sqrt(sqr(r2)- sqr(xx))
-
- #declare Column =
- object {
- difference {
- intersection {
- object { Cylinder_Y scale < r1 r1 r1 > }
- box { <-r1 , -r1, -r1> <r1, r1, r1> }
- }
- FOR angle <0 360 a>
- object { Cylinder_Y
- scale < r2 r2 r2 >
- translate < d* cos(angle), 0, d * sin(angle) >
- }
- ENDFOR
- }
- texture { ColumnTexture }
- }
-
- //••••••••••• I M A G E ••••••••••••
-
- // ---- pentacle constituted of 5 carved columns -------
-
- #declare dev = 20
- #declare dist = 20
- #declare col_scale = .5
-
- FOR i <0+dev, 360+dev, 360/5>
- object { Column scale < col_scale, 6.5*col_scale, col_scale >
- translate < dist*sin(i), 0, dist*cos(i)>
- }
- ENDFOR
-
- //--------- GROUND ---------
-
- object {
- plane { <0 1 0> 0 }
- texture {
- pigment {
- color red 0 green 0 blue 0
- }
- finish {
- reflection 0
- ambient 0
- diffuse 0
- }
- }
- texture {
- pigment {
- Sapphire_Agate
- scale <5 5 5 >
- }
- normal { wrinkles 1 }
- finish {
- reflection 0.8
- diffuse 1.1
- phong 1
- }
- }
-
- scale <.4 .4 .4>
- translate < 0 0 0 >
- }
-
-